﻿#r @"..\Microsoft.SharePoint.Client (spo)\Microsoft.SharePoint.Client.dll"
#r @"..\Microsoft.SharePoint.Client (spo)\Microsoft.SharePoint.Client.Runtime.dll"

#load "Client.fs"

open Client
open Microsoft.SharePoint.Client
open Microsoft.SharePoint.Client.Sharing
open Microsoft.SharePoint.Client.Utilities
open Microsoft.SharePoint.Client.WebParts
open Microsoft.SharePoint.Client.Application
open System.Security;

// =======================================================
// Send email
// =======================================================

let mail = new Microsoft.SharePoint.Client.Utilities.EmailProperties()
mail.To <- [|"me@geek.onmicrosoft.com"|]
mail.Subject <- "Testmail X"
mail.Body <- @"<div style=""margin-left:20px;"">
        <p style=""font-family:Segoe UI Light;font-size:21pt;margin-bottom:0px;color:rgb(68,68,68)"">
            Go to <a href=""https://geek.sharepoint.com/"" style=""color:rgb(0,114,188);"" >Testmail</a>
        </p>
        <p style=""font-size:10.5pt;font-family:Segoe UI;margin-top:0px;color:rgb(68,68,68)"">
            Check this out.
        </p>
    </div>"

Utilities.Utility.SendEmail(Client.Context, mail)
Client.ExecuteQuery()
